import logging

import yagmail


def log_set():
    logging.basicConfig(level=logging.DEBUG,filename='log.txt',format='%(message)s -> %(asctime)s',filemode='a')
def send_mail(filepath):
    mail=yagmail.SMTP(user='1042748142@qq.com',password='kjjgspvzmqzebbhi',host='smtp.qq.com')
    mail.send(to='1042748142@qq.com',subject='测试报告',contents='测试报告，请查看',attachments=filepath)